package net.zjitc.service.Impl;

import net.zjitc.dao.Impl.ProductDaoImpl;
import net.zjitc.dao.ProductDao;
import net.zjitc.domain.Product;
import net.zjitc.service.ProductService;
import utils.PageBean;

import java.util.List;

/**
 * Created by guo on 2017/11/22.
 */
public class ProductImpl implements ProductService{
    ProductDao dao=new ProductDaoImpl();

    public PageBean<Product> findPageBean(int page, int pageSize) {
        return dao.findPageBean(page,pageSize);
    }

    public int insert(Product product) {
        return dao.insert(product);
    }

    public int delete(int pid) {
        return dao.delete(pid);
    }

    public Product findProductById(int pid) {
        return dao.findProductById(pid);
    }

    public int update(Product product) {
        return dao.update(product);
    }

    public List<Product> findAllHotProduct() {
        return dao.findAllHotProduct();
    }

    public List<Product> findAllNewProduct() {
        return dao.findAllNewProduct();
    }

    public PageBean<Product> findPageBeanByCid(int page, int pageSize, int cid) {
        return dao.findPageBeanByCid(page,pageSize,cid);
    }

    public PageBean<Product> findPageByCsid(int page, int pageSize, int csid) {
        return dao.findPageByCsid(page,pageSize,csid);
    }
}
